package project;

import java.util.Scanner;
public class WXH {
    public static void main(String[] args) {
        int pice = 0;
        String str = "y";

        while ("y".equalsIgnoreCase(str)) {
            System.out.print("请输入金额：");
            Scanner sc = new Scanner(System.in);
            int temp = sc.nextInt();
            pice += temp;

            System.out.print("是否继续？(y/n):");
            str = sc.next();


        }
        System.out.println("总金额：" + pice);
    }
}
